/*
 * testerQuickSort.cpp
 *
 *  Created on: Sep 15, 2011
 *      Author: dgdiniz
 */

#include <iostream>
#include <stdio.h>
#include "sort/quickSort.hpp"

using namespace std;
using namespace playlib;


void    RunTestsQuickSort()
{
	int listToSortInt[10] = {9,8,7,6,5,4,3,2,1,0};
	string listToSortString[10] = {"Douglas", "Gisele", "casa", "maria", "amor", "moly", "Dream", "Loja", "carinho", "tudo"};

	cout << "Before Quick Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;

	quickSort(&listToSortInt[0], 10);

	cout << "After Quick Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;



	cout << "\n\n\nBefore Quick Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortString[i];

	cout << endl;

	quickSort(&listToSortString[0], 10);

	cout << "After Quick Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortString[i];

	cout << endl;



	cout << "\n\n\nBefore Quick Sort Dec:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;

	quickSortDec(&listToSortInt[0], 10);

	cout << "After Quick Sort Dec:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;


}

void testerQuickSort()
{
	cout << "\n\n\n\nTESTER-QUICK-SORT ---  Testing Quick Sort\n";
	RunTestsQuickSort();
	cout << "TESTER-QUICK-SORT ---  FINISHED!\n\n\n\n";
}
